﻿<UserControl x:Class="Ewav.Users"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    mc:Ignorable="d"
    d:DesignHeight="914" d:DesignWidth="614">
    

    <Border Background="White" BorderBrush="#FFC0CFE2" Padding="0" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="4" >
    	<Border.Effect>
    		<DropShadowEffect Color="#FFBCB9B9" ShadowDepth="3" BlurRadius="43" Direction="166"/>
    	</Border.Effect>
    

		<Grid x:Name="LayoutRoot">
			<Grid x:Name="HeaderGrid" Margin="0" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" Height="39" >
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="0.917*"/>
					<ColumnDefinition Width="25"/>
				</Grid.ColumnDefinitions>
				<TextBlock TextWrapping="Wrap" Text="Users" FontSize="21.333" FontWeight="Bold" FontFamily="Segoe UI" Width="235" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment" VerticalAlignment="Top" Margin="10,5,0,0"/>
				<Rectangle x:Name="GHeader" VerticalAlignment="Top" Height="4" Margin="10,33,0,0" StrokeThickness="0" Fill="#FF00B050" HorizontalAlignment="Left" Width="117" />
			</Grid>
			<!--</StackPanel>--> 
    <!--<StackPanel Margin="10,0,0,0" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">-->

			<StackPanel x:Name="grdUsers" HorizontalAlignment="Left" Margin="10,39,10,10" VerticalAlignment="Top" Visibility="Visible">
				<TextBlock TextWrapping="Wrap" Text="Organization:" FontSize="18.667" FontFamily="Segoe UI" HorizontalAlignment="Left" Margin="10,14,5,-4"/>
				<ComboBox x:Name="cmbOrgName"   DropDownClosed="cmbOrgName_DropDownClosed" Width="224" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="130,-23,0,0"/>
				<StackPanel x:Name="spMsg" VerticalAlignment="Top" Orientation="Horizontal" Margin="10,16,10,0" Background="#FFDCECBB" UseLayoutRounding="True" Visibility="Collapsed">
						<Image x:Name="imgerrMsg" HorizontalAlignment="Left" Height="20" Source="../../images/ErrorD.png" Stretch="Fill" Width="20" VerticalAlignment="Center" Margin="10,6,0,6" Visibility="Collapsed"/>
						<Image x:Name="imgSMsg" HorizontalAlignment="Left" Height="20" Source="../../images/successD.png" Stretch="Fill" Width="20" VerticalAlignment="Center" Margin="10,6,0,6"/>
						<TextBlock x:Name="errMsg" TextWrapping="Wrap" Text="" FontFamily="Segoe UI" Foreground="#FF445818" Margin="6,6,0,6" FontSize="13.333" FontWeight="Bold" VerticalAlignment="Center"/>
					</StackPanel>
				<Button x:Name="btnAddNewUser" Content="Add New User" Width="155" Margin="8,20,0,5" HorizontalAlignment="Left" Click="btnAddNewUser_Click" Style="{StaticResource btnprimary}" Canvas.ZIndex="30" Height="30"/>
				<sdk:DataPager PageSize="10" VerticalAlignment="Top" Margin="8,-36,0,0" Background="{x:Null}" HorizontalAlignment="Left" Visibility="Collapsed" />
				<sdk:DataGrid x:Name="dgUsers" RowHeight="35" AutoGenerateColumns="False" DataContext="{Binding}" HorizontalAlignment="Left" MaxHeight="400" VerticalAlignment="Top" AreRowGroupHeadersFrozen="False" Margin="8,1,0,0" IsReadOnly="True" MinHeight="250">
					<sdk:DataGrid.Columns>
						<sdk:DataGridTextColumn Binding="{Binding FirstName}" Header="First Name" Width="160"/>
						<sdk:DataGridTextColumn Binding="{Binding LastName}" Header="Last Name" Width="160"/>
						<sdk:DataGridTextColumn Binding="{Binding Email}" Header="Email" Width="160"/>
						<sdk:DataGridTextColumn Binding="{Binding Phone}" Header="Phone" Width="160"/>
                        <sdk:DataGridTextColumn Binding="{Binding UserRoleInOrganization}" Header="Role" Width="130"/>
                        <sdk:DataGridTextColumn Binding="{Binding IsActive}" Header="Active" Width="80"/>
                        <sdk:DataGridTextColumn Binding="{Binding DatasourceCount}" Header="Datasources" Width="100"/>
						<sdk:DataGridTemplateColumn Width="80" >
							<sdk:DataGridTemplateColumn.CellTemplate>
								<DataTemplate>
									<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="8,0,0,0">
										<Button Content="Edit" Click="Edit_Click" VerticalAlignment="Top" HorizontalAlignment="Left" d:LayoutOverrides="VerticalAlignment" Width="60" Style="{StaticResource btnprimary}"/>
										<!--<TextBlock Text="" Width="15"/>
										<Button Content="Delete" FontFamily="Segoe UI" FontSize="13.333" Background="#FF63A6DF" Click="Delete_Click" Foreground="White" VerticalAlignment="Top" HorizontalAlignment="Left" d:LayoutOverrides="VerticalAlignment" Width="60" Style="{StaticResource btnstyle1}" />-->
									</StackPanel>
								</DataTemplate>
							</sdk:DataGridTemplateColumn.CellTemplate>
						</sdk:DataGridTemplateColumn>
					</sdk:DataGrid.Columns>
				</sdk:DataGrid>
				<TextBlock Height="19" TextWrapping="Wrap" Text="No Users have been added." Width="194" HorizontalAlignment="Left" Margin="8,-127,0,0" Visibility="Collapsed"/>
			</StackPanel>
            <Grid x:Name="waitCursor" Background="#36C4C4C4" Height="Auto" Visibility="Collapsed">
                <toolkit:BusyIndicator x:Name="BusyIndicator" IsBusy="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="100" Style="{StaticResource busy}" />
            </Grid>
        </Grid>
	</Border>
</UserControl>
